<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>活动列表</title>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery.form/4.2.1/jquery.form.min.js"></script>
</head>
<body>
<form method="post" action="/activity/add" id="theform" name="theform">
    活动名称:<input type="text" name="name"/><br/>
    <input type="button" value="提交" id="sub"/>
</form>
</body>
</html>
<script type="text/javascript">
    $("#sub").click(function () {
        $("#theform").ajaxSubmit({
            success: function (data) {
                if (data == 'ok') {
                    window.location.href = "/activity/list";
                }
            }
        });
    });
</script>